﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuTouTiaoAssist.Util;

namespace QuTouTiaoAssist
{
    public partial class FrmReadArticleManual : FrmBase
    {
        public FrmReadArticleManual()
        {
            InitializeComponent();
        }

        private void btnRead_Click(object sender, EventArgs e)
        {
            if (!base.CheckLogin())
                return;

            if (OtherUtil.IsNullOrWhitespace(this.textBox1.Text))
            {
                MsgBox.ShowInfo("请输入文章Key！");
                return;
            }

            var result = QttHelper.ReadArticle(base.MemberInfo.MemberId, base.MemeberToken, this.textBox1.Text.Trim());
            MsgBox.ShowInfo(string.Format("阅读{0}", result.Code == 0
                ? "奖励+" + result.Data.Amount
                : "失败，错误码：" + result.Code));
        }
    }
}
